<%@ Reference Control="~/Controls/GroupBlogTabs.ascx" %>
<%@ Reference Control="~/Controls/UserMsgTabs.ascx" %>
<%@ Reference Control="~/Controls/PagingControl.ascx" %>
<%@ Register tagprefix="Pager" Tagname="DataGridPager" Src="Controls/PagingControl.ascx" %>
<%@ Register tagprefix="UserMsgTabs" Tagname="UserMsgTabs" Src="Controls/UserMsgTabs.ascx" %>
<%@ Register tagprefix="GroupBlogTabs" Tagname="GroupBlogTabs" Src="Controls/GroupBlogTabs.ascx" %>
<%@ Page language="vb" EnableViewStateMac="true" Inherits="_2bMatesSite.messages_trash" CodeFile="messages_trash.aspx.vb" CodeFileBaseClass="_2bMatesSite.BaseWebPage" %>
<form id="Form1" method="post" runat="server">
	<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" height="100%">
		<tr>
			<td colspan="3">
				<table cellspacing="0" cellpadding="0" width="100%" border="0" class="page_title" id="Table1">
					<tr>
						<td><asp:literal id="litMainPageTitle" runat="server">Messages - Trash</asp:literal></td>
						<td align="right"><asp:hyperlink id="hlBackToGroup" cssclass="white_link" runat="server"></asp:hyperlink></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td valign="top" height="100%" class="main_table_border">
				<div class="content">
					<table cellSpacing="0" cellPadding="0" width="100%" border="0" class="main_text">
						<tr id="trUserCanceledMessage" runat=server class="hidden">
							<td align=center height="20"><asp:label id="lblErrMessageCanceled" runat=server cssclass="err_canceled_user">This member has cancelled their membership.</asp:label></td>
						</tr>
						<usermsgtabs:usermsgtabs id="ucTabs" runat="server"></usermsgtabs:usermsgtabs>
						<GroupBlogTabs:GroupBlogTabs id="grpBlogTabs" runat="server"></GroupBlogTabs:GroupBlogTabs>													
						<tr>
							<td class="small" height="15">&nbsp;</td>
						</tr>
						<tr>
							<td>
								<asp:Label id="lblNoMessages" runat="server" Visible="False">There are no messages in this folder.</asp:Label><asp:Table id="tblMessages" runat="server" width="100%" cellspacing=0 cellpadding=0>
									<asp:TableRow VerticalAlign="Top">
										<asp:TableCell VerticalAlign="Top">
											<table cellspacing="0" cellpadding="0" border="0" width="100%">
												<tr>
													<td valign="middle"><Pager:DataGridPager id="dgPagerUp" runat="server"></Pager:DataGridPager></td>
												</tr>
												<tr>
													<td>
														<ASP:DATAGRID id="dgTrash" runat="server" AutoGenerateColumns="False" GridLines="None" Width="100%" AllowPaging="True" PagerStyle-Mode="NumericPages" PagerStyle-HorizontalAlign="Right" CellPadding="0" AllowSorting="True" AllowCustomPaging="True">
															<itemstyle verticalalign="Top" cssclass="data_grid"></ItemStyle>
															<headerstyle cssclass="data_grid_header"></HeaderStyle>
															<columns>
																<asp:TemplateColumn>
																	<headerstyle width="30px"></HeaderStyle>
																	<headertemplate>
																		<asp:CheckBox id="chkSelectAll" onclick="javascript:SelectAll(this.checked, this.id);" runat="server" AutoPostBack="false" ToolTip="Select/Deselect All"></asp:CheckBox>
																	</HeaderTemplate>
																	<itemtemplate>
																		<asp:CheckBox id="chkSelect" runat="server" AutoPostBack="false" OnClick="javascript: SelectAll(this.checked, this.id);" value='<%# DataBinder.Eval(Container.DataItem, "MessageIDAndType") %>'>
																		</asp:CheckBox>
																	</ItemTemplate>
																	<footerstyle horizontalalign="Left" verticalalign="Top"></FooterStyle>
																</asp:TemplateColumn>
																<asp:TemplateColumn>
																	<headerstyle width="30px"></HeaderStyle>
																	<headertemplate>&nbsp;</HeaderTemplate>
																	<itemtemplate>&nbsp;</ItemTemplate>
																	<footerstyle horizontalalign="Left" verticalalign="Top"></FooterStyle>
																</asp:TemplateColumn>																								
																<asp:BoundColumn DataField="Date" HeaderText="Date">
																	<headerstyle width="80px"></HeaderStyle>
																</asp:BoundColumn>
																<asp:TemplateColumn HeaderText="From">
																	<headerstyle width="160px"></HeaderStyle>
																	<itemstyle cssclass="data_grid_underline"></itemstyle>
																	<itemtemplate>
																		<asp:Hyperlink id=hlSender runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "URL") %>' onclick='<%# DataBinder.Eval(Container.DataItem, "OnClickJS") %>'>
																			<%# DataBinder.Eval(Container.DataItem, "SenderName") %>
																		</asp:Hyperlink>
																			<table cellspacing="0" cellpadding="0" border="0">
																				<tr>
																					<td class="data_grid_clear">
																						<asp:HyperLink id=hlSenderImage runat="server" CssClass="small_image" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "URL") %>' ImageUrl='<%# DataBinder.Eval(Container.DataItem, "From") %>' onclick='<%# DataBinder.Eval(Container.DataItem, "OnClickJS") %>' ToolTip='<%# DataBinder.Eval(Container.DataItem, "SenderFullName") %>'>HyperLink</asp:HyperLink>
																					</td>
																				</tr>
																				<tr>
																					<td align="center" class="data_grid_clear">	
																						<asp:image id="imgOnline" runat="server" imageurl='<%# DataBinder.Eval(Container.DataItem, "OnlineImg") %>' >
																						</asp:image>
																					</td>
																				</tr>																	
																			</table>																		
																	</ItemTemplate>
																</asp:TemplateColumn>
																<asp:templatecolumn headertext="Type">
																<headerstyle width="80px"></headerstyle>
																	<itemtemplate><asp:image id="imgType" runat="server" imageurl='<%# DataBinder.Eval(Container.DataItem, "TypeImageURL") %>' imagealign="AbsMiddle" tooltip='<%# DataBinder.Eval(Container.DataItem, "TypeName") %>'></asp:image></itemtemplate>
																</asp:templatecolumn>
																<asp:TemplateColumn HeaderText="Subject">
																	<headerstyle width="440px"></HeaderStyle>
																	<itemstyle cssclass="data_grid_underline"></itemstyle>
																	<itemtemplate>
																		<asp:HyperLink id="hlSubject" runat="server" NavigateURL='<%# DataBinder.Eval(Container.DataItem, "ViewMsgURL") %>' >
																			<%# DataBinder.Eval(Container.DataItem, "Subject") %>
																		</asp:HyperLink>
																	</ItemTemplate>
																</asp:TemplateColumn>
															</Columns>
															<pagerstyle verticalalign="Top" visible="False" horizontalalign="Right" mode="NumericPages"></PagerStyle>
														</ASP:DATAGRID>
													</td>
												</tr>
												<tr>
													<td valign="middle">
														<Pager:DataGridPager id="dgPager" runat="server"></Pager:DataGridPager></td>
												</tr>
												<tr>
													<td><img height="10" src="images/spacer.gif" width="100%"></td>
												</tr>
												<tr id="trAllFunctions" runat=server>
													<td height="30"><br />
														<a id="lSelectAll" onclick="javascript: SelectAll(true, 'SelectAll');" href="#" class="main_text_bold" style="font-size:13px !important">Select All</a><font class="main_text_err" style="font-size:13px !important">&nbsp;|&nbsp;</font><a id="lClearAll" onclick="javascript: SelectAll(false, 'SelectAll');" href="#" class="main_text_bold" style="font-size:13px !important">Clear All</a><br />
													</td>
												</tr>
												<tr>
													<td><br />
														<asp:button id="btnDelete" runat="server" Text="Delete" CssClass="btn"  onmouseover="ButtonMouseOver(this);" onmouseout="ButtonMouseOut(this);" onclick="btnDelete_Click"></asp:button><br />&nbsp;<br />
													</td>
												</tr>
											</table>
										</asp:TableCell>
									</asp:TableRow>
								</asp:Table>
							</tr>
						</td>
					</table>			
				</div>	
			</td>
			<!-- BEGIN SKYSCRAPER ADVERTISEMENT -->	
			<!--
			<td class="small" width="10">&nbsp;</td>
			<td class="border_adv" vAlign="top" width="203" height="100%">
				<table cellSpacing="1" cellPadding="0" width="100%" border="0">
					<tr>
						<td class="small" width="10">&nbsp;</td>
						<td class="advertisement" width="193"><asp:Literal id="litSkyscraperAdvertisement" runat=server></asp:literal></td>
					</tr>
				</table>
			</td>-->
			<!-- END SKYSCRAPER ADVERTISEMENT -->	
		</tr>
	</table>
</form>
<script language="JavaScript">
function SelectAll(chkVal, idVal) 
{ 
    var frm = document.forms[0];
    
    // Loop through all elements
    for (i=0; i<frm.length; i++) 
    {
        
        // Look for our Header Template's Checkbox
        if (idVal.indexOf ('SelectAll') != -1) 
        {
            // Check if main checkbox is checked, then select or deselect datagrid checkboxes 
                frm.elements[i].checked = chkVal;
            // Work here with the Item Template's multiple checkboxes
        }
        else if(idVal.indexOf ('chkSelect') != -1)
        {
			if(!chkVal){
				frm.elements[3].checked = chkVal;
			}	
        }
        else if (idVal.indexOf ('DeleteThis') != -1) 
        {
            // Check if any of the checkboxes are not checked, and then uncheck top select all checkbox
            if(frm.elements[i].checked == false) 
            {
                frm.elements[3].checked = false; //Uncheck main select all checkbox
            }
        }
    }
}
</script>

